import React from 'react'
import { Link } from 'react-router-dom'
import { Routes, Route, Navigate} from 'react-router'
import { KanbanPage } from 'pages/Kanban'
import { EpicPage } from 'pages/Epic'

export const ProjectPage = () => {
  return (
    <div>
      <h1>ProjectPage</h1>
      <Link to={'kanban'}>看板</Link>
      <Link to={'epic'}>任务组</Link>
      <Routes>
        <Route path={'/kanban'} element={<KanbanPage/>}/>
        <Route path={'/epic'} element={<EpicPage/>} />
        {/* 如果其他路由匹配不到就匹配到该路由 */}
        {/* <Navigate to={window.location.pathname + '/kanban'} /> */}
        <Route path="*" element={<Navigate to={window.location.pathname + "/kanban"} replace={true} />} />
      </Routes>
    </div>
  )
}